﻿<UserControl
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:ctrl="clr-namespace:VS.Infrastructure.Controls;assembly=VS.Infrastructure"
    xmlns:conv="clr-namespace:VS.Infrastructure.Converters;assembly=VS.Infrastructure"
    xmlns:System="clr-namespace:System;assembly=mscorlib" x:Class="VS.MainModule.Views.ToolbarView"
    mc:Ignorable="d"    
    d:DataContext="{d:DesignData /SampleData/ToolbarViewModelSampleData.xaml}"
    HorizontalAlignment="Left" VerticalAlignment="Top">
    <UserControl.Resources>
        <conv:StaticResourceConverter x:Key="StaticResourceConverter"/>
        <!--<DataTemplate x:Key="ToolbarItemTemplate">
            <StackPanel Orientation="Horizontal" Margin="2,0" ToolTipService.ToolTip="{Binding Label}">
                <ContentControl Content="{Binding Uri, Converter={StaticResource StaticResourceConverter}}" RenderTransformOrigin="0.5,0.5">
                    <ContentControl.RenderTransform>
                		<CompositeTransform ScaleY="0.75" ScaleX="0.75"/>
                	</ContentControl.RenderTransform>
                </ContentControl>
            </StackPanel>
        </DataTemplate>-->
        <DataTemplate x:Key="ToolbarItemTemplate">
            <StackPanel Orientation="Horizontal" Margin="2,0" ToolTipService.ToolTip="{Binding Label}">
                <ctrl:XamlControl Uri="{Binding Uri}" RenderTransformOrigin="0.5,0.5" SourceAssembly="VS.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" >
                    <ctrl:XamlControl.RenderTransform>
                        <CompositeTransform ScaleY="0.75" ScaleX="0.75"/>
                    </ctrl:XamlControl.RenderTransform>
                </ctrl:XamlControl>
            </StackPanel>
        </DataTemplate>
    </UserControl.Resources>

    <StackPanel>
        <ctrl:OverlapListBox 
        ItemsSource="{Binding Commands}" 
        ctrl:SelectorBehaviors.IsZIndexSetOnSelection="True" 
        ItemTemplate="{StaticResource ToolbarItemTemplate}"
        ctrl:SelectorBehaviors.CommandPath="Command"
        />
    </StackPanel>


</UserControl>
